﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WUCVisitorSpaceLeft.ascx.cs"
    Inherits="NJL.Web.Controls.WUCVisitorSpaceLeft1" %>
<%@ Import Namespace="Royalsoft.Common" %>
<div class="w_200 float_l">
    <!--个人资料-->
    <div class="boxgreen">
        <div class="titlePerson">
            <h2>
                <a>个人资料</a></h2>
        </div>
        <div class="cont">
            <!--头像-->
            <div class="center">
                <asp:Image ID="Image1" runat="server" Width="108px" Height="80px" class="picBor"
                    BorderWidth="1" />
            </div>
            <div class="lineinfo">
                <p class="name">
                    <asp:Literal ID="litName" runat="server"></asp:Literal></p>
                <p>
                    性别：
                    <asp:Literal ID="litSex" runat="server"></asp:Literal></p>
                <p>
                    积分：<asp:Literal ID="litScore" runat="server"></asp:Literal>分</p>
            </div>
            <!--留言-->
            <div class="messageinfo">
                <span><a href="/wanjia/<%=Request.QueryString["uid"] %>-ly.html"
                    class="messagelink">我要留言</a></span> <span>
                        <%
                            if (UserId != "" && UserId == Request.QueryString["uid"])
                            {

                        %>
                          <a class="attionlink" id="a1" href="/wanjia/<%=Request.QueryString["uid"] %>-gz.html">
                            查看关注</a>
                        <%
   
                            }
                            else
                            {

                                if (isFriend == "")
                                {
                        %>
                        <a class="attionlink" id="attention" href="javascript:AddUser('<%=Request.QueryString["uid"] %>')">
                            添加关注</a>
                        <%
                                }
                                 else if (isFriend == "true")
                                     {
                        %>
                        <a class="attionlink" id="deleteFriend" href="javascript:DeleteUser('<%=Request.QueryString["uid"] %>')">
                            取消关注</a>
                        <%
                                     }
                             }                             
                        %>
                    </span>
            </div>
            <script type="text/javascript">
                function AddUser(userid) {
                    $.ajax({
                        type: 'get',
                        url: '/Handle/Handler.ashx',
                        data: 'userid=' + userid + '&Random=' + Math.random(),
                        dataType: 'text',
                        success: function (msg) {
                            if (msg == "true") {
                                alert("添加关注成功")
                                window.location.reload();
                            }
                            else {
                                if (msg == "nologin") {
                                    document.location.href = '/Login.aspx?url=' + location.href;
                                }
                            }
                        },
                        error: function () {
                            alert("添加关注失败");
                        }
                    })
                }
                function DeleteUser(userid) {
                    $.ajax({
                        type: 'get',
                        url: '/Handle/Handler.ashx',
                        data: 'deleteFriend=' + userid + '&Random=' + Math.random(),
                        dataType: 'text',
                        success: function (msg) {
                            if (msg == "true") {
                                alert("取消关注成功");
                                window.location.reload();

                            }
                        },
                        error: function () {

                        }
                    })
                }
            </script>
        </div>
    </div>
    <!--最近来访-->
    <div class="blank">
    </div>
    <div class="boxgreen">
        <div class="titlePerson">
            <h2>
                <a>最近来访</a></h2>
        </div>
        <div class="cont">
            <ul class="imglist cleanFlex">
                <asp:Repeater ID="rptLogUser" runat="server">
                    <ItemTemplate>
                        <li style="height: 80px; width: 75px; overflow: hidden;"><a target="_blank" href="/wanjia/<%#Eval("CREATE_USER_ID") %>-index.html">
                            <img src="<%#Eval("IMAGE_CODE").ToString()!=""?GetImageUrl(Eval("IMAGE_CODE").ToString(),"U2"):"/Images/avatar.jpg" %>"
                                alt="" width="67px" height="50px" class="picBor" />
                        </a>
                            <p>
                                <a target="_blank" href="/wanjia/<%#Eval("CREATE_USER_ID") %>-index.html">
                                    <%#PageValidate.SqlText(Eval("CREATE_USER_NAME").ToString(),6)%></a></p>
                        </li>
                    </ItemTemplate>
                </asp:Repeater>
            </ul>
            <div class="cleanFlex">
            </div>
        </div>
    </div>
    <!--我的关注-->
    <div class="blank cleanFlex">
    </div>
    <div class="boxgreen">
        <div class="titlePerson">
            <h2>
                <a target="_blank" href="/wanjia/<%=Request.QueryString["uid"] %>-gz.html">
                    <%
                        if (UserId != null && UserId == Request.QueryString["uid"])
                        {
                    %>
                    我的关注
                    <%
                         
                        }
                        else
                        {
                    %>
                    他的关注
                    <%
                        }
                    %>
                </a>
            </h2>
        </div>
        <div class="cont">
            <ul class="imglist cleanFlex">
                <asp:Repeater ID="rptUserFriend" runat="server">
                    <ItemTemplate>
                        <li style="height: 80px; width: 75px; overflow: hidden;"><a target="_blank" href="/wanjia/<%#Eval("ID1") %>-index.html">
                            <img src="<%#Eval("IMAGE_CODE").ToString()!=""?GetImageUrl(Eval("IMAGE_CODE").ToString(),"U2"):"/Images/avatar.jpg" %>"
                                alt="" width="67px" height="50px" class="picBor" />
                        </a>
                            <p>
                                <a target="_blank" href="/wanjia/<%#Eval("ID1") %>-index.html">
                                    <%#Eval("USER_NAME")%></a></p>
                        </li>
                    </ItemTemplate>
                </asp:Repeater>
            </ul>
            <div class="more cleanFlex">
                <p>
                    <a href="/wanjia/<%=Request.QueryString["uid"] %>-gz.html" target="_blank">查看更多</a></p>
            </div>
        </div>
    </div>
</div>
<!--弹出层-->
<div id="sendMes" style="display: none; width: 360px;">
    <ul>
        <li>
            <textarea id="TextArea1" rows="10" style="width: 100%"></textarea>
        </li>
        <li style="text-align: right">
            <input id="Button1" type="button" value="确定" class="greenBtn02" onclick="SendMes()" />&nbsp;&nbsp;
            <input id="Button2" type="button" value="取消" class="greenBtn02" onclick="$.skygqbox.hide();" />
        </li>
    </ul>
</div>
<script type="text/javascript">
    function getUserId(userid) {
        document.getElementById("hiduserid").value = userid;
    }
    function SendMes() {
        var userid = document.getElementById("hiduserid").value
        var content = document.getElementById("TextArea1").value;
        content = $.trim(content);
        if (content == "") {
            alert("内容不能为空哦^_^")
            return false;
        }
        if (content.length > 500) {
            alert("发送消息不能超过500个字符哦");
            return false;
        }
        $.ajax({
            type: 'POST',
            url: '../Handle/Handler.ashx',
            data: 'sendUserid=' + userid + '&content=' + escape(content) + '&Random=' + Math.random(),
            dataType: 'text',
            success: function (msg) {
                if (msg == "true") {
                    document.getElementById("TextArea1").value = "";
                    alert("发送信息成功");
                    $.skygqbox.hide();
                }
            },
            error: function () {
                $.skygqbox.hide();
            }
        })
    }
</script>
